<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.6.3.min.js">
        
    </script>
</head>
<body>
    <input type="text" name="studentId" id="studentId">
    <input type="text" name="studentName" id="studentName">
    <input type="submit" value="提交" id="submit">
</body>
<script>
    $("#submit").click(function(){
          // 获取studentId
          let studentId = $("#studentId").val();
        // 获取学生姓名 
        let studentName = $("#studentName").val();
        // 构造成一个JS对象
        let postDate = {
            "studentId" : studentId,
            "studentName" : studentName
        };
        $.ajax(
            {
                type: "post",
                url: "jackson",
                contentType : "application/json",
                data: JSON.stringify(postDate),
                success: function(){
                    console.log("操作成功");
                }
            }
        )

    });
</script>
</html>